﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RunCircle
{
    public class PlayerStatusMgr
    {
        public PlayerStatusMgr(Player pplayer)
        {
            m_pPlayer = pplayer;
        }

        public void SetPlayerStatus(PlayerStatus status)
        {
            if (m_PlayerStatus != null)
            {
                m_PlayerStatus.Exit(m_pPlayer);
            }

            m_PlayerStatus = status;

            m_PlayerStatus.Enter(m_pPlayer);
        }

        public PlayerStatus GetCurPlayerStatus()
        {
            return m_PlayerStatus;
        }

        public void update(float dt)
        {
            if (m_PlayerStatus != null)
            {
                m_PlayerStatus.Execute(m_pPlayer);
            }
        }

        private PlayerStatus m_PlayerStatus;

        Player m_pPlayer;
    }
}
